<%= form_for(user, url:'/sign_up') do |f| %>
    <% if user.errors.any? %>
        <div id="error_explanation">
          <h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2>

          <ul>
            <% user.errors.full_messages.each do |message| %>
                <li><%= message %></li>
            <% end %>
          </ul>
        </div>
    <% end %>

    <div class="field">
      <%= f.label :name %>
      <%= f.text_field :name, :required => true %>
    </div>

    <div class="field">
      <%= f.label :username %>
      <%= f.text_field :username, :required => true %>
    </div>

    <div class="field">
      <%= f.label :email %>
      <%= f.text_field :email,:required => true %>
    </div>

    <div class="field">
      <%= f.label :password %>
      <%= f.password_field :password,:required => true %>
    </div>
    <div class="field">
      <%= f.label :password_confirmation %>
      <%= f.password_field :password_confirmation,:required => true %>
    </div>

    <div class="actions">
      <%= f.submit  value= "注册" %>
    </div>
<% end %>
